home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / lamstex / inputs / islands.tex < prev    next >
Text File  |  1991-09-06  |  19KB  |  580 lines

  1. \catcode`\@=11
  2. \def\Figureproofing{\figproofing@true}
  3. \def\noFigureproofing{\figproofing@false}
  4. \def\Hbyw#1{\global\Hby@true\hbyw\vsize{#1}}
  5. \def\hbyw#1#2{%
  6.  \hbox{%
  7.   \ifHby@
  8.   \else
  9.    \iffigproofing@
  10.     \setbox\z@\vbox{\hrule\width5\p@}\ht\z@\z@
  11.     \vbox to#1{\hrule\height5\p@\width.4\p@\vfil\hrule\height5\p@\width.4\p@}%
  12.     \kern-.4\p@\rlap{\copy\z@}\raise#1\hbox{\rlap{\copy\z@}}%
  13.    \fi
  14.   \fi
  15.   \vbox to#1{\hbox to#2{}\vfil}%
  16.   \ifHby@
  17.   \else
  18.    \iffigproofing@
  19.     \vbox to#1{\hrule\height5\p@\width.4\p@\vfil\hrule\height5\p@\width.4\p@}%
  20.     \kern-.4\p@\llap{\copy\z@}\raise#1\hbox{\llap{\boxz@}}%
  21.    \fi
  22.   \fi}}
  23. \def\island@@@P{\csname\exxx@\islandtype@ @P\endcsname}
  24. \def\island@@@Q{\csname\exxx@\islandtype@ @Q\endcsname}
  25. \def\island@@@S{\csname\exxx@\islandtype@ @S\endcsname}
  26. \def\island@@@N{\csname\exxx@\islandtype@ @N\endcsname}
  27. \def\island@@@F{\csname\exxx@\islandtype@ @F\endcsname}
  28. \def\island@@@C{\csname island@C\islandclass@\endcsname}
  29. \def\island{%
  30.  \ifplace@
  31.   \DN@{\let\islandclass@\empty\def\islandtype@{\island}\FN@\island@}%
  32.  \else
  33.   \long\DN@##1\endisland{\Err@{\noexpand\island must be used after some
  34.    type of \string\...place}}%
  35.  \fi
  36.  \next@}
  37. \def\island@{\ifx\next\c\let\next@\island@c\else
  38.  \DN@{\FN@\island@@}\fi\next@}
  39. \def\island@@{\ifcat\bgroup\noexpand\next\let\next@\island@@@\else
  40.  \DN@{\Err@{\noexpand\island must be followed by a {prefix} for
  41.  \string\caption's}}\fi\next@}
  42. \def\island@@@#1{\def\captionprefix@{#1}\captioncount@\z@
  43.  \global\setbox\islandbox@\vbox\bgroup}
  44. \def\island@c\c#1{%
  45.  \ifplace@
  46.  \DN@{\def\islandclass@{#1}%
  47.   \expandafter\ifx\csname island@C#1\endcsname\relax
  48.   \expandafter\newcount@\csname island@C#1\endcsname
  49.    \global\csname island@C#1\endcsname\z@\fi
  50.   \FNSS@\island@c@}%
  51.  \else
  52.  \DN@{\edef\next@{\long\def\noexpand\next@########1\expandafter\noexpand
  53.   \csname end\exxx@\islandtype@\endcsname{\noexpand\Err@{\noexpand\noexpand
  54.   \expandafter\noexpand
  55.   \islandtype@ must be used after some type of \noexpand\string
  56.    \noexpand\...place}}}\next@\next@}%
  57.  \fi
  58.  \next@}
  59. \def\island@c@{%
  60.  \ifcat\bgroup\noexpand\next
  61.   \let\next@\island@c@@
  62.  \else
  63.   \DN@{\Err@{\noexpand\island\string\c{\expandafter\string\islandclass@} must
  64.    be followed by a {prefix} for \string\caption's}}%
  65.  \fi\next@}
  66. \def\island@c@@#1{\def\captionprefix@{#1}%
  67.  \captioncount@\z@\global\setbox\islandbox@\vbox\bgroup}
  68. \def\caption{%
  69.  \ifnum\captioncount@=\z@
  70.   \ifnopunct@
  71.    \DN@{\egroup\nopunct@true}%
  72.   \else
  73.    \let\next@\egroup
  74.   \fi
  75.  \else
  76.   \let\next@\relax
  77.  \fi
  78.  \next@
  79.  \advance\captioncount@\@ne
  80.  \FN@\caption@}
  81. \def\caption@{\ifx\next"\expandafter\caption@q\else\expandafter\caption@@\fi}
  82. \def\caption@q"#1"{\quoted@true
  83.  {\noexpands@
  84.  \let\pre\island@@@P\let\post\island@@@Q
  85.  \let\style\island@@@S\let\numstyle\island@@@N
  86.  \Qlabel@{#1}\let\style\relax\xdef\Qlabel@@@@{#1}}%
  87.  \finishcaption@}
  88. \def\caption@@{\quoted@false
  89.  \global\advance\island@@@C\@ne
  90.  {\noexpands@
  91.  \xdef\Thelabel@@@{\number\island@@@C}%
  92.  \xdefThelabel@\island@@@N
  93.  \xdef\Thelabel@@@@{\island@@@P\Thelabel@\island@@@Q}%
  94.  \xdefThelabel@@\island@@@S
  95.  \xdef\Thepref@{\Thelabel@@@@}}%
  96.  \finishcaption@}
  97. \long\def\widerthanisland@#1#2#3{\test@true\setbox\z@\vbox{\hsize\maxdimen
  98.  \noindent@@\captionformat@{#1}{#2}{#3}\par\setboxzl@}%
  99.  \ifdim\wdz@=\z@
  100.   \global\setbox\captionbox@\hbox{\noset@\unlabel@
  101.    \captionformat@{#1}{#2}{#3}}%
  102.   \ifdim\wd\captionbox@>\wd\islandbox@\else\test@false\fi
  103.  \fi}
  104. \long\def\captionformat@@#1#2#3{\widerthanisland@{#1}{#2}{#3}%
  105.  \iftest@
  106.   \global\setbox\captionbox@\vbox{\hsize\wd\islandbox@
  107.    \vskip-\parskip\noindent@@\noset@\unlabel@
  108.    \captionformat@{#1}{#2}{#3}\par}%
  109.  \else
  110.   \global\setbox\captionbox@
  111.    \hbox to\wd\islandbox@{\hfil\box\captionbox@\hfil}%
  112.  \fi}
  113. \long\def\finishcaption@#1{\def\entry@{#1}%
  114.  {\locallabel@
  115.  \captionformat@@
  116.   {\expandafter\ignorespaces\captionprefix@\unskip}%
  117.   {\ifx\thelabel@@\empty\unskip\else\thelabel@@\fi}%
  118.   {\ignorespaces#1\unskip}%
  119.  \ifnum\captioncount@=\@ne
  120.   \global\setbox\islandbox@\vbox{\ticwrite@\vbox{\box\islandbox@}}%
  121.   \global\setbox\Captionbox@\vbox{\box\captionbox@}%
  122.  \else
  123.   \global\setbox\islandbox@\vbox{\unvbox\islandbox@\setboxzl@
  124.    \ticwrite@\boxz@}%
  125.   \global\setbox\Captionbox@\vbox{\unvbox\Captionbox@
  126.    \smallskip\box\captionbox@}%
  127.  \fi}%
  128.  \nopunct@false\nospace@false}
  129. \def\Sixtic@{\ifx\macdef@\empty\else
  130.  \DN@##1##2\next@{\def\macdef@{##1##2}}%
  131.  \expandafter\next@\macdef@\next@
  132.  \edef\next@
  133.   {\noexpand\six@\tic@\macdef@
  134.   \space\space\space\space\space\space\space\space\space\space\space\space
  135.   \noexpand\six@}%
  136.  \next@\let\macdef@\relax\fi}
  137. \def\ticwrite@{%
  138.  \iftoc@
  139.   {\noexpands@\let\style\relax
  140.   \DN@{\island}%
  141.   \edef\next@{\write\tic@{%
  142.    \ifnopunct@\noexpand\noexpand\noexpand\nopunct\fi
  143.    \ifx\islandtype@\next@\noexpand\noexpand\noexpand\island
  144.     \noexpand\string\noexpand\c{\islandclass@}{\captionprefix@}%
  145.      {\QorThelabel@@@@}\else\noexpand\noexpand\expandafter\noexpand
  146.      \islandtype@{\QorThelabel@@@@}}\fi}%
  147.   \next@}%
  148.   \expandafter\unmacro@\meaning\entry@\unmacro@
  149.   \Sixtic@
  150.   \write\tic@{\noexpand\Page{\number\pageno}{\page@N}{\page@P}{\page@Q}^^J}%
  151.  \fi}
  152. \def\Htrim@#1{%
  153.  \ifHby@
  154.   \dimen@\vsize
  155.   \ifnum\captioncount@=\z@
  156.   \else
  157.    \advance\dimen@-\ht\Captionbox@
  158.    \advance\dimen@-#1%
  159.   \fi
  160.   \global\Hby@false
  161.   \dimen@ii\wd\islandbox@
  162.   \global\setbox\islandbox@\vbox
  163.    {\unvbox\islandbox@\setboxzl@
  164.    \vbox to\z@{\vss\boxz@}\nointerlineskip\hbyw\dimen@\dimen@ii}%
  165.   \global\Hby@true
  166.  \fi}
  167. \def\iclasstest@#1{\DN@{#1}\ifx\next@\islandclass@
  168.  \test@true\else\test@false\fi}
  169. \def\endisland{\ifnum\captioncount@=\z@\expandafter\egroup\fi
  170.  \ifdata@
  171.  \else
  172.   \iclasstest@{T}%
  173.   \iftest@
  174.    {\rm\global\skipi@-\dp\strutbox}\global\advance\skipi@\bigskipamount
  175.    \Htrim@\skipi@
  176.    \global\setbox\islandbox@\vbox
  177.     {\ifnum\captioncount@=\z@\else
  178.      \box\Captionbox@
  179.      \nointerlineskip
  180.      \vskip\skipi@\fi
  181.      \box\islandbox@}%
  182.   \else
  183.    {\rm\global\skipi@\dp\strutbox}\global\advance\skipi@\medskipamount
  184.    \Htrim@\skipi@
  185.    \global\setbox\islandbox@\vbox
  186.     {\box\islandbox@
  187.      \ifnum\captioncount@=\z@\else
  188.      \nointerlineskip
  189.      \vskip\skipi@
  190.      \box\Captionbox@
  191.      \fi}%
  192.   \fi
  193.   \ifHby@
  194.   \else
  195.    \dimen@\ht\islandbox@\advance\dimen@\dp\islandbox@
  196.    \ifdim\dimen@>\vsize
  197.     \DN@{\island}%
  198.     \Err@{%
  199.      \ifx\islandtype@\next@\noexpand\island\else
  200.       \expandafter\noexpand\islandtype@\fi
  201.      \ifnum\captioncount@=\z@\else
  202.        with \noexpand\caption\fi
  203.       is larger than page}%
  204.      \ht\islandbox@=\vsize
  205.    \fi
  206.   \fi
  207.  \fi
  208.  \global\Hby@false\island@true}
  209. \def\newisland#1\c#2#3{\define#1{}%
  210.  \iftoc@\immediate\write\tic@{\noexpand\newisland\noexpand#1%
  211.   \string\c{#2}{#3}^^J}\fi
  212.  \expandafter\def\csname\exstring@#1@S\endcsname{\island@S}%
  213.  \expandafter\def\csname\exstring@#1@N\endcsname{\island@N}%
  214.  \expandafter\def\csname\exstring@#1@P\endcsname{\island@P}%
  215.  \expandafter\def\csname\exstring@#1@Q\endcsname{\island@Q}%
  216.  \expandafter\def\csname\exstring@#1@F\endcsname{\island@F}%
  217.  \expandafter\def\csname end\exstring@#1\endcsname{\endisland}%
  218.  \expandafter
  219.  \ifx\csname island@C#2\endcsname\relax
  220.   \expandafter\newcount@\csname island@C#2\endcsname
  221.   \global\csname island@C#2\endcsname\z@
  222.  \fi
  223.  \edef\next@{\noexpand\expandafter\noexpand\let\noexpand
  224.   \csname\exstring@#1@C\noexpand\endcsname
  225.   \csname island@C#2\endcsname}%
  226.  \next@
  227.  \def#1{\def\islandtype@{#1}\island@c\c{#2}{#3}}}
  228. \newisland\Figure\c{F}{Figure}
  229. \newisland\Table\c{T}{Table}
  230. \long\def\islandpairdata#1#2{{\data@true
  231.  \place@true
  232.  #1%
  233.  \global\setbox\islandboxi\box\islandbox@
  234.  \global\setbox\captionboxi\box\Captionbox@
  235.  #2%
  236.  \global\setbox\islandboxii\box\islandbox@
  237.  \global\setbox\captionboxii\box\Captionbox@
  238.  }}
  239. \long\def\islandpairbox#1#2{\islandpairdata{#1}{#2}%
  240.  \dimen@\ht\captionboxi
  241.  \ifdim\ht\captionboxii>\dimen@\dimen@\ht\captionboxii\fi
  242.  \ifdim\dimen@>\z@
  243.   \ifdim\ht\captionboxi<\dimen@
  244.    \global\setbox\captionboxi\vbox to\dimen@{\unvbox\captionboxi\vfil}\fi
  245.   \ifdim\ht\captionboxii<\dimen@
  246.    \global\setbox\captionboxii\vbox to\dimen@{\unvbox\captionboxii\vfil}\fi
  247.  \fi
  248.  \global\setbox\islandbox@\vbox
  249.  {\hbox to\hsize{\hfil\box\islandboxi\hfil\box\islandboxii\hfil}%
  250.  \ifdim\dimen@>\z@\nointerlineskip
  251.  {\rm\global\skipi@\dp\strutbox}\global\advance\skipi@\medskipamount
  252.   \vskip\skipi@
  253.   \hbox to\hsize{\hfil\box\captionboxi\hfil\box\captionboxii\hfil}\fi}}    
  254. \long\def\islandpairboxa#1#2{\islandpairdata{#1}{#2}%
  255.  \dimen@\ht\captionboxi
  256.  \ifdim\ht\captionboxii>\dimen@\dimen@\ht\captionboxii\fi
  257.  \ifdim\dimen@>\z@
  258.   \ifdim\ht\captionboxi<\dimen@
  259.    \global\setbox\captionboxi\vbox to\dimen@{\vfil\unvbox\captionboxi}\fi
  260.   \ifdim\ht\captionboxii<\dimen@
  261.    \global\setbox\captionboxii\vbox to\dimen@{\vfil\unvbox\captionboxii}\fi
  262.  \fi
  263.  \dimen@ii\ht\islandboxi
  264.  \ifdim\ht\islandboxii>\dimen@ii \dimen@ii\ht\islandboxii\fi
  265.  \ifdim\dimen@ii>\z@
  266.   \ifdim\ht\islandboxi<\dimen@ii
  267.    \global\setbox\islandboxi\vbox to\dimen@ii{\box\islandboxi\vfil}\fi
  268.   \ifdim\ht\islandboxii<\dimen@ii
  269.    \global\setbox\islandboxii\vbox to\dimen@ii{\box\islandboxii\vfil}\fi
  270.  \fi
  271.  \global\setbox\islandbox@\vbox{\ifdim\dimen@>\z@
  272.   \hbox to\hsize{\hfil\box\captionboxi\hfil\box\captionboxii\hfil}%
  273.   \nointerlineskip{\rm\global\skipi@-\dp\strutbox}%
  274.   \global\advance\skipi@\bigskipamount\vskip\skipi@\fi
  275.   \hbox to\hsize{\hfil\box\islandboxi\hfil\box\islandboxii\hfil}}}
  276. \long\def\islandtripledata#1#2#3{{\data@true\place@true
  277.  #1%
  278.  \global\setbox\islandboxi\box\islandbox@
  279.  \global\setbox\captionboxi\box\Captionbox@
  280.  #2%
  281.  \global\setbox\islandboxii\box\islandbox@
  282.  \global\setbox\captionboxii\box\Captionbox@
  283.  #3%
  284.  \global\setbox\islandboxiii\box\islandbox@
  285.  \global\setbox\captionboxiii\box\Captionbox@
  286.  }}
  287. \long\def\islandtriplebox#1#2#3{\islandtripledata{#1}{#2}{#3}%
  288.  \dimen@\ht\captionboxi
  289.  \ifdim\ht\captionboxii>\dimen@ \dimen@\ht\captionboxii\fi
  290.  \ifdim\ht\captionboxiii>\dimen@ \dimen@\ht\captionboxiii\fi
  291.  \ifdim\dimen@>\z@
  292.   \ifdim\ht\captionboxi<\dimen@
  293.    \global\setbox\captionboxi\vbox to\dimen@{\unvbox\captionboxi\vfil}\fi
  294.   \ifdim\ht\captionboxii<\dimen@
  295.    \global\setbox\captionboxii\vbox to\dimen@{\unvbox\captionboxii\vfil}\fi
  296.   \ifdim\ht\captionboxiii<\dimen@
  297.    \global\setbox\captionboxiii\vbox to\dimen@{\unvbox\captionboxiii\vfil}\fi
  298.  \fi
  299.  \global\setbox\islandbox@\vbox
  300.   {\hbox to\hsize{\hfil\box\islandboxi\hfil\box\islandboxii\hfil
  301.    \box\islandboxiii\hfil}%
  302.  \ifdim\dimen@>\z@\nointerlineskip
  303.   {\rm\global\skipi@\dp\strutbox}\global\advance\skipi@\medskipamount
  304.   \vskip\skipi@
  305.   \hbox to\hsize{\hfil\box\captionboxi\hfil\box\captionboxii\hfil
  306.    \box\captionboxiii\hfil}\fi}}
  307. \def\islandtripleboxa#1#2#3{\islandtripledata{#1}{#2}{#3}%
  308.  \dimen@\ht\captionboxi
  309.  \ifdim\ht\captionboxii>\dimen@ \dimen@\ht\captionboxii\fi
  310.  \ifdim\ht\captionboxiii>\dimen@ \dimen@\ht\captionboxiii\fi
  311.  \ifdim\dimen@>\z@
  312.   \ifdim\ht\captionboxi<\dimen@
  313.    \global\setbox\captionboxi\vbox to\dimen@{\vfil\unvbox\captionboxi}\fi
  314.   \ifdim\ht\captionboxii<\dimen@
  315.    \global\setbox\captionboxii\vbox to\dimen@{\vfil\unvbox\captionboxii}\fi
  316.   \ifdim\ht\captionboxiii<\dimen@
  317.    \global\setbox\captionboxiii\vbox to\dimen@{\vfil\unvbox\captionboxiii}\fi
  318.  \fi
  319.  \dimen@ii\ht\islandboxi
  320.  \ifdim\ht\islandboxii>\dimen@ii \dimen@ii\ht\islandboxii\fi
  321.  \ifdim\ht\islandboxiii>\dimen@ii \dimen@ii\ht\islandboxiii\fi
  322.  \ifdim\dimen@ii>\z@
  323.   \ifdim\ht\islandboxi<\dimen@ii
  324.    \global\setbox\islandboxi\vbox to\dimen@ii{\box\islandboxi\vfil}\fi
  325.   \ifdim\ht\islandboxii<\dimen@ii
  326.    \global\setbox\islandboxii\vbox to\dimen@ii{\box\islandboxii\vfil}\fi
  327.   \ifdim\ht\islandboxiii<\dimen@ii
  328.    \global\setbox\islandboxiii\vbox to\dimen@ii{\box\islandboxiii\vfil}\fi
  329.  \fi
  330.  \global\setbox\islandbox@\vbox
  331.   {\ifdim\dimen@>\z@
  332.   \hbox to\hsize{\hfil\box\captionboxi\hfil\box\captionboxii\hfil
  333.    \box\captionboxiii\hfil}%
  334.   \nointerlineskip{\rm\global\skipi@-\dp\strutbox}%
  335.   \global\advance\skipi@\bigskipamount\vskip\skipi@\fi
  336.   \hbox to\hsize{\hfil\box\islandboxi\hfil\box\islandboxii\hfil
  337.    \box\islandboxiii\hfil}}}
  338. \def\Figurepair#1\and#2\endFigurepair{\island@true
  339.  \islandpairbox{\Figure#1\endFigure}{\Figure#2\endFigure}}
  340. \def\Figuretriple#1\and#2\and#3\endFiguretriple{\island@true
  341.  \islandtriplebox{\Figure#1\endFigure}{\Figure#2\endFigure}%
  342.   {\Figure#3\endFigure}}
  343. \def\Tablepair#1\and#2\endTablepair{\island@true
  344.  \islandpairboxa{\Table#1\endTable}{\Table#2\endTable}}
  345. \def\Tabletriple#1\and#2\and#3\endTabletriple{\island@true
  346.  \islandtripleboxa{\Table#1\endTable}{\Table#2\endTable}%
  347.  {\Table#3\endTable}}
  348. \def\place#1{\place@true\island@false
  349.  #1%
  350.  \ifisland@
  351.   \box\islandbox@
  352.  \else
  353.   \Err@{Whoa ... there's no \string\Figure, \string\Table,
  354.    etc., here}%
  355.  \fi
  356.  \place@false}
  357. \def\storedim@{\global\setbox\topinsdims@
  358.  \vbox{\hbox to\dimen@{}\unvbox\topinsdims@}}
  359. \def\advancedimtopins@{%
  360.  \ifnum\pageno=\@ne
  361.  \else
  362.    \advance\dimen@\dimen\topins
  363.    \global\dimen\topins\dimen@
  364.  \fi}
  365. \def\Par{\par\global\csname Parprev1\endcsname\prevdepth
  366.  \global\Parcount@\@ne
  367.  \global\Par@true\global\let\Parlist@\empty
  368.  \global\setbox\Parbox@\vbox\bgroup\break}
  369. \def\place@#1#2{%
  370.  \ifisland@
  371.   \ifhmode
  372.    \ifPar@
  373.     \ifnum\Parcount@>5
  374.      \Err@{Only 5 \string\place's allowed per
  375.       \string\Par...\noexpand\endPar paragraph}%
  376.     \else
  377.      \expandafter\expandafter\expandafter
  378.       \global\expandafter\setbox
  379.        \csname Parfigbox\number\Parcount@\endcsname\box\islandbox@
  380.      \global\advance\Parcount@\@ne
  381.      \xdef\Parlist@{\Parlist@#1}%
  382.     \fi
  383.    \else
  384.     \vadjust{#2}%
  385.    \fi
  386.   \else
  387.    #2%
  388.   \fi
  389.  \else
  390.   \Err@{Whoa ... there's no \string\Figure,
  391.    \string\Table, etc., here}%
  392.  \fi
  393.  \place@false}
  394. \long\def\Aplace#1{\prevanish@
  395.  \place@true\island@false
  396.  #1%
  397.  \place@ a\Aplace@
  398.  \postvanish@}
  399. \long\def\AAplace#1{\prevanish@\place@true\island@false
  400.  #1%
  401.  \place@ A\AAplace@
  402.  \postvanish@}
  403. \def\AAplace@{\AA@true\Aplace@\AA@false}
  404. \def\Aplace@{\allowbreak
  405.  \dimen@=\ht\islandbox@
  406.  \advance\dimen@\abovebotfigskip
  407.  \ht\islandbox@\dimen@
  408.  \advance\dimen@\dp\islandbox@
  409.  \storedim@
  410.  \ifAA@
  411.   \xdef\AAlist@{\AAlist@1}%
  412.   \advancedimtopins@
  413.  \else
  414.   \xdef\AAlist@{\AAlist@0}%
  415.   \ifnum\topinscount@>\@ne\else\advancedimtopins@\fi
  416.  \fi
  417.  \insert\topins{\penalty\z@\splittopskip\z@\floatingpenalty\z@
  418.   \box\islandbox@}%
  419.  \global\advance\topinscount@\@ne}
  420. \long\def\Bplace#1{\prevanish@\place@true\island@false
  421.  #1%
  422.  \place@ b\Bplace@
  423.  \postvanish@}
  424. \def\Bplace@{\allowbreak
  425.  \ifnum\topinscount@=\z@
  426.   \setbox\z@\vbox{\vbox to-\belowtopfigskip{}}%
  427.   \dimen@-\skip\topins
  428.   \ht\z@\dimen@
  429.   \storedim@
  430.   \advancedimtopins@
  431.   \insert\topins{\boxz@}%
  432.   \global\advance\topinscount@\@ne
  433.   \xdef\AAlist@{\AAlist@0}%
  434.  \fi
  435.  \dimen@\ht\islandbox@
  436.  \advance\dimen@\abovebotfigskip
  437.  \ht\islandbox@\dimen@
  438.  \advance\dimen@\dp\islandbox@
  439.  \storedim@
  440.  \xdef\AAlist@{\AAlist@0}%
  441.  \ifnum\topinscount@>\@ne\else\advancedimtopins@\fi
  442.  \insert\topins{\penalty\z@\splittopskip\z@
  443.   \floatingpenalty\z@
  444.   \box\islandbox@}%
  445.  \global\advance\topinscount@\@ne}
  446. \def\Place@#1#2{%
  447.  \ifisland@
  448.   \ifhmode
  449.    \ifPar@
  450.     \ifnum\Parcount@>5
  451.      \Err@{Only 5 \string\place's allowed per
  452.        \string\Par...\noexpand\endPar paragraph}%
  453.     \else
  454.      \expandafter\expandafter\expandafter\global\expandafter\setbox
  455.       \csname Parfigbox\number\Parcount@\endcsname\box\islandbox@
  456.      \global\advance\Parcount@\@ne
  457.      \xdef\Parlist@{\Parlist@#1}%
  458.      \vadjust{\break}%
  459.     \fi
  460.    \else
  461.     \Err@{\noexpand#2allowed only in a \string\Par...\noexpand\endPar
  462.      paragraph}%
  463.    \fi
  464.   \else
  465.    #2%
  466.   \fi
  467.  \else
  468.   \Err@{Who ... there's no \string\Figure, \string\Table,
  469.    etc., here}%
  470.  \fi
  471.  \place@false}
  472. \long\def\Cplace#1{\prevanish@\place@true\island@false
  473.  #1%
  474.  \Place@ c\Cplace@
  475.  \postvanish@}
  476. \def\Cplace@{\allowbreak
  477.  \ifnum\topinscount@>\z@\else
  478.   \global\C@true\global\Cdim@\pagetotal\fi
  479.  \Aplace@}
  480. \long\def\Mplace#1{\prevanish@\place@true\island@false
  481.  #1%
  482.  \Place@ m\Mplace@
  483.  \postvanish@}
  484. \long\def\MXplace#1{\prevanish@\place@true\island@false
  485.  #1%
  486.  \Place@ M\MXplace@
  487.  \postvanish@}
  488. \def\MXplace@{\MX@true\Mplace@\MX@false}
  489. \def\Mplace@{\allowbreak
  490.  \dimen@\ht\islandbox@\advance\dimen@\dp\islandbox@
  491.  \ifdim\pagetotal=\z@\else
  492.   \ifdim\lastskip<\abovebotfigskip\advance\dimen@\abovebotfigskip
  493.   \advance\dimen@-\lastskip\fi
  494.  \fi
  495.  \advance\dimen@\pagetotal
  496.  \ifdim\dimen@>\pagegoal
  497.   \Aplace@
  498.  \else
  499.   \nointerlineskip
  500.   \ifdim\lastskip<\abovebotfigskip\removelastskip\vskip\abovebotfigskip\fi
  501.   \setbox\z@\vbox{\unvbox\islandbox@
  502.    \breakisland@}%
  503.   \printisland@
  504.   \ifnum\topinscount@=\z@
  505.    \setbox\z@\vbox{\vbox to-\belowtopfigskip{}}%
  506.    \dimen@-\skip\topins
  507.    \ht\z@\dimen@
  508.    \storedim@
  509.    \advancedimtopins@
  510.    \insert\topins{\boxz@}%
  511.    \global\advance\topinscount@\@ne
  512.    \xdef\AAlist@{\AAlist@0}%
  513.   \fi
  514.   \ifMX@
  515.    \ifnum\topinscount@=\@ne
  516.     \setbox\z@\vbox{\vbox to-\abovebotfigskip{}}%
  517.     \ht\z@\z@
  518.     \dimen@\z@
  519.     \storedim@
  520.     \advancedimtopins@
  521.     \insert\topins{\boxz@}%
  522.     \global\advance\topinscount@\@ne
  523.     \xdef\AAlist@{\AAlist@0}%
  524.    \fi
  525.   \fi
  526.   \nointerlineskip
  527.   \vskip\belowtopfigskip
  528.  \fi}
  529. \def\endPar{\egroup
  530.  \count@\@ne
  531.  {\vbadness\@M\vfuzz\maxdimen\splitmaxdepth\maxdimen\splittopskip\ht\strutbox
  532.  \setbox\z@\vsplit\Parbox@ to\ht\Parbox@
  533.  \loop
  534.   \ifnum\count@<\Parcount@
  535.   \expandafter\expandafter\expandafter\global\expandafter\setbox
  536.    \csname Parbox\number\count@\endcsname\vsplit\Parbox@ to\ht\Parbox@
  537.   \count@@\count@\advance\count@@\@ne
  538.   \global\csname Parprev\number\count@@\endcsname
  539.    \dp\csname Parbox\number\count@\endcsname
  540.   \advance\count@\@ne
  541.   \repeat}%
  542.  \vskip\parskip
  543.  \count@\@ne
  544.  \def\nextv@##1##2\nextv@{\DN@{##1}\gdef\Parlist@{##2}}%
  545.  \loop
  546.   \ifnum\count@<\Parcount@
  547.    \dimen@\csname Parprev\number\count@\endcsname
  548.    \advance\dimen@\ht\strutbox
  549.    \ifdim\dimen@<\baselineskip
  550.     \advance\dimen@-\baselineskip\vskip-\dimen@
  551.    \else
  552.     \vskip\lineskip
  553.    \fi
  554.    \unvbox\csname Parbox\number\count@\endcsname
  555.    \global\setbox\islandbox@\box\csname Parfigbox\number\count@\endcsname
  556.    \expandafter\nextv@\Parlist@\nextv@
  557.    \if a\next@\Aplace@\else
  558.    \if A\next@\AAplace@\else
  559.    \if b\next@\Bplace@\else
  560.    \if c\next@\Cplace@\else
  561.    \if m\next@\Mplace@\else
  562.    \if M\next@\MXplace@\fi\fi\fi\fi\fi\fi
  563.   \advance\count@\@ne
  564.   \repeat
  565.  \global\Par@false
  566.  \ifvoid\Parbox@
  567.   \prevdepth\csname Parprev\number\count@\endcsname
  568.  \else
  569.   \dimen@\csname Parprev\number\count@\endcsname\advance\dimen@\ht\strutbox
  570.   \ifdim\dimen@<\baselineskip
  571.     \advance\dimen@-\baselineskip\vskip-\dimen@
  572.   \else
  573.     \vskip\lineskip
  574.   \fi
  575.   \dimen@\dp\Parbox@
  576.   \unvbox\Parbox@
  577.   \prevdepth\dimen@
  578.  \fi}
  579. \catcode`\@=\active
  580.